package com.beadhouse.bed.web.spring;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.beadhouse.common.dto.JSONResponse;
import com.beadhouse.common.exeption.BeadHouseException;
import com.sun.prism.j2d.J2DPipeline;

@ControllerAdvice
public class ExceptionHandlerAdvice {
	@ExceptionHandler
	@ResponseBody
	public JSONResponse handleSystemException(BeadHouseException e) {
		e.printStackTrace();
		return JSONResponse.fail(e);
	}
	@ExceptionHandler
	@ResponseBody
	public JSONResponse handleSystemException(Exception e) {
		e.printStackTrace();
		return JSONResponse.fail(e);
	}
}
